package model;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import net.ck.hzq.Fragment1_businessmanagement;
import net.ck.hzq.Fragment2_businessmanagement;

public class BusinessmanagementFragmentPagerAdapter extends FragmentPagerAdapter {

    private String[] mTitles = new String[]{"1", "2"};

    public BusinessmanagementFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        if (position == 1) {
            return new Fragment2_businessmanagement();
        }
        return new Fragment1_businessmanagement();
    }

    @Override
    public int getCount() {
        return mTitles.length;
    }

    //ViewPager与TabLayout绑定后，这里获取到PageTitle就是Tab的Text
    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles[position];
    }

}
